import { ApiProperty } from '@nestjs/swagger';
import { IsOptional, IsString, IsNumber, IsArray, IsEnum, IsBoolean, IsInt } from 'class-validator';
import { Type } from 'class-transformer';

/**
 * Excel导入数据DTO
 */
export class ImportExcelDto {
  @ApiProperty({ 
    description: '竞彩编号',
    required: false 
  })
  @IsOptional()
  @IsString()
  jingcaiNumber?: string;

  @ApiProperty({ 
    description: '北单编号',
    required: false 
  })
  @IsOptional()
  @IsString()
  beidanNumber?: string;

  @ApiProperty({ 
    description: '开赛时间',
    required: false 
  })
  @IsOptional()
  @IsString()
  matchTime?: string;

  @ApiProperty({ 
    description: '赛事',
    required: false 
  })
  @IsOptional()
  @IsString()
  leagueName?: string;

  @ApiProperty({ 
    description: '主队',
    required: false 
  })
  @IsOptional()
  @IsString()
  homeTeam?: string;

  @ApiProperty({ 
    description: '客队',
    required: false 
  })
  @IsOptional()
  @IsString()
  awayTeam?: string;

  @ApiProperty({ 
    description: '竞彩单关',
    required: false 
  })
  @IsOptional()
  @IsString()
  jingcaiSingle?: string;

  @ApiProperty({ 
    description: '竞彩让球',
    required: false 
  })
  @IsOptional()
  @IsNumber()
  @Type(() => Number)
  jingcaiHandicap?: number;

  @ApiProperty({ 
    description: '北单让球',
    required: false 
  })
  @IsOptional()
  @IsNumber()
  @Type(() => Number)
  beidanHandicap?: number;

  @ApiProperty({ 
    description: '胜',
    required: false 
  })
  @IsOptional()
  @IsNumber()
  @Type(() => Number)
  winOdds?: number;

  @ApiProperty({ 
    description: '平',
    required: false 
  })
  @IsOptional()
  @IsNumber()
  @Type(() => Number)
  drawOdds?: number;

  @ApiProperty({ 
    description: '负',
    required: false 
  })
  @IsOptional()
  @IsNumber()
  @Type(() => Number)
  loseOdds?: number;

  @ApiProperty({ 
    description: 'ID',
    required: false 
  })
  @IsOptional()
  @IsString()
  externalId?: string;

  @ApiProperty({ 
    description: '胆推荐',
    required: false 
  })
  @IsOptional()
  @IsEnum(['none', 'recommend_bold', 'recommend_stable'])
  boldRecommendation?: string;

  @ApiProperty({ 
    description: '主队胜率',
    required: false 
  })
  @IsOptional()
  @IsNumber()
  @Type(() => Number)
  homeWinRate?: number;

  @ApiProperty({ 
    description: '客队胜率',
    required: false 
  })
  @IsOptional()
  @IsNumber()
  @Type(() => Number)
  awayWinRate?: number;

  @ApiProperty({ 
    description: '备注',
    required: false 
  })
  @IsOptional()
  @IsString()
  remarks?: string;

  @ApiProperty({ 
    description: '推荐结果',
    required: false 
  })
  @IsOptional()
  @IsArray()
  @IsEnum(['win', 'draw', 'lose'], { each: true })
  recommendedResult?: string[];

  @ApiProperty({ 
    description: '主比分',
    required: false 
  })
  @IsOptional()
  @IsInt()
  @Type(() => Number)
  homeScore?: number;

  @ApiProperty({ 
    description: '客比分',
    required: false 
  })
  @IsOptional()
  @IsInt()
  @Type(() => Number)
  awayScore?: number;

  @ApiProperty({ 
    description: '赛果',
    required: false 
  })
  @IsOptional()
  @IsEnum(['win', 'draw', 'lose'])
  matchResult?: string;

  @ApiProperty({ 
    description: '预测命中',
    required: false 
  })
  @IsOptional()
  @IsBoolean()
  predictionHit?: boolean;
}